import { defineStore } from 'pinia'
import router from '../router'
export const usePageStore = defineStore('page', {
  state() {
    return {
      activeIndex: '0'
    }
  },
  actions: {
    gotoModifyInfo() {
      this.activeIndex = '4';
      router.push({ path: '/userHub/modifyUserInfo' });
    },
    goToUserInfo() {
      this.activeIndex = '1';
      router.push({ path: '/userHub/userInfo' });
    },
    goToUserFav() {
      this.activeIndex = '2';
      router.push({ path: '/userHub/userFav' });
    },
    goToUserPublish() {
      this.activeIndex = '3';
      router.push({ path: '/userHub/userPublish' });
    },
    goToPublish() {
      this.activeIndex = '4';
      router.push({ path: '/userHub/publish' });
    }
  }
})